package com.liu.controller;

import com.liu.service.intf.ViewDetailService;
import com.liu.service.intf.ViewService;
import com.liu.vo.R;
import io.swagger.annotations.Api;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/api/view/")
@CrossOrigin
@Api(tags = "景点相关操作",value = "景点相关操作")
public class ViewController {
    @Autowired
    private ViewService service;
    @Autowired
    private ViewDetailService viewDetailService;
    @GetMapping("query")
    public R queryAll(){
        System.out.println("query");

        return service.queryAllView();
    }
    @GetMapping("queryOne")
    public R queryvieByVid(int vid){
        System.out.println("queryOne");
        System.out.println(viewDetailService.queryViewDetailByVid(vid).getData());
        return viewDetailService.queryViewDetailByVid(vid);
    }
}
